package com.tx.review.string_;

/**
 *
 */
public class StringDemo {
    public static void main(String[] args) {

        //1、测试是否创建了StringBuilder
       /* String a = "hello";
        String b = " world";
        String c = "!!!";

        String d = a + b + c;
//        d = d + c;
        System.out.println(d);*/


        //2、测试两个字符串直接相加，是否会默认拼好
       /* String a = "hello" + "world";
        System.out.println(a);*/



       //3、测试final字符串变量是否会默认拼好
       /* String s0 = "ab";
        final String s1 = "b";*/


       //4、测试final字符串的方法，是否会创建StringBuilder
        final String s1 = getStr();
        String s2 = "w" + s1;
        System.out.println(s2);



    }


    public static String getStr(){
        return "b";
    }
}